Skip to content

Conversation

@blockchainluffy
Copy link
Contributor

No description provided.

@blockchainluffy blockchainluffy self-assigned this Jun 13, 2025
@blockchainluffy blockchainluffy marked this pull request as ready for review June 13, 2025 12:52

func Min1GweiGasPriceFn(suggestedGasTipCap *big.Int, suggestedGasPrice *big.Int, _ int, _ int) (GasFeeCap, GasTipCap) {
gasFeeCap, gasTipCap := DefaultGasPriceFn(suggestedGasTipCap, suggestedGasPrice, 0, 1)
func MinGasTipUpdateFn(suggestedGasTipCap *big.Int, suggestedGasPrice *big.Int, _ int, _ int) (GasFeeCap, GasTipCap) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fee calculation still needs an adjustment to ensure we don't run into fee too low errors:

  1. maxFeePerGas is currently derived from SuggestGasPrice (legacy). That can under‑estimate the base fee at inclusion time and trigger “fee too low.” We should derive maxFeePerGas from the current block baseFee and add a buffer for the next N blocks (N configurable with a high upper-bound for simplicity or based on target slot).

  2. The previous function enforced a minimum priority fee of 1 gwei. The updated approach does not take into account the suggested gas tip and rather enforces a maximum of 1gwei. My previous suggestion was to set a configuredMinTip (no hardcoded 1 gwei), so we still take into account the suggestGasTip (which is not the case here anymore). In addition, we should make sure maxFeePerGas >= maxPriorityFeePerGas otherwise the transaction is invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants